const fs = require('fs')
//引入path模块
const path = require('path')
//调用path.jion和__dirname拼接目标文件的绝对路径

fs.readFile(path.join(__dirname,'../test.txt'),(err,data)=>{
    if(err) console.log(err)
    else console.log(data.toString())
    
})